const initialState = {
    data: []
};

export const actionsTypes = {
    UPDATE_RESULT: "UPDATE_RESULT",
    UPDATED_RESULT: "UPDATED_RESULT"
};

export const actions = {
    update_result: function (data) {
        return {
            type: actionsTypes.UPDATE_RESULT,
            data
        }
    },
}

export function reducer(state=initialState, action) {
    switch (action.type) {
        case actionsTypes.UPDATED_RESULT:
        return {
            ...state,
            data: action.data
        } 
        default:
            return state
    }
}